<?php
include('gest_login.php');
include("database.php");

	if(!$_GET['by_admin'])
		logout();
	mysql_select_db($database_database, $database);
	$sql = "DELETE FROM users WHERE id='".$_GET['id']."'";
	$result = mysql_query($sql, $database) or die(mysql_error());
	$sql = "DELETE FROM sessions WHERE id='".$_GET['id']."'";
	$result = mysql_query($sql, $database) or die(mysql_error());
	
	if(!$_GET['by_admin'])
		header("Location: index.php?code_err=5");
	else
		header("Location: admin/users.php");

?>